{% set clazz = "home"; %}
{% set title = curProject %}
{% extends './modules/common/templates/main.html' %}
{% block style %}
  <link rel="stylesheet" href="{{ '/static/css/delivery.css'|version }}" />
{% endblock %}
{% block content %}
  {% if !nested %}
    <header class="bar bar-header">
      {{ macro.back() }}
      <h1>{{ curProject }}</h1>
    </header>
  {% endif %}
  <section>
  	<input type="hidden" id="hiddenP" data-projects="{{projects | json}}" />
    <div class="tabs compact sign-tabs tm-tab" data-tabs="true">
      <a href="#unsign" class="item dely-unsign">待抢单</a>
      <a href="#signed" class="item active dely-signed">已抢单</a>
      <a href="#signcancel" class="item dely-signcancel">已取消</a>
    </div>
    <div id="signed" class="tabpane active">
      <div class="card vspace">
      {% if expresses.list.length > 0 %}
        {% for item in expresses.list %}
          <div class="item round">
              <div class="list compact">
              	<div class="item" style="background: #f7f7f7;">
              		<div class="progress">
              			<div class="line"></div>
              			<div class="flexbox">
              				<div class="item">
              					{% if item.dispatchStatus == 10 %}
              					<div class="circle circlef activec"></div>
              					<p class="text text-sm vspace text-left text-orange">已接单</p>
              					{% else %}
              					<div class="circle circlef"></div>
              					<p class="text text-sm vspace text-left">已接单</p>
              					{% endif %}

              				</div>
              				<div class="item">
              				    {% if item.dispatchStatus == 11 %}
              					<div class="circle circlem activec"></div>
              					<p class="text text-sm vspace text-center text-orange">配送中</p>
              					{% else %}
              					<div class="circle circlem"></div>
              					<p class="text text-sm vspace text-center">配送中</p>
              					{% endif %}

              				</div>
              				<div class="item">
              					{% if item.dispatchStatus == 12 %}
              					<div class="circle circled activec"></div>
              					<p class="text text-sm vspace text-right text-orange">已完成</p>
              					{% else %}
              					<div class="circle circled"></div>
              					<p class="text text-sm vspace text-right">已完成</p>
              					{% endif %}

              				</div>
              			</div>
              		</div>
              	</div>
                <a class="item" href="/delivery/expressd/{{item.code}}">
                  <span class="text text-sm text-gray">
                    <p>配送单号：{{item.code}}</p>
                    <p>配送时间:  {{item.postDate}} {{item.postWeek}} {{item.postPeriod | postPeriodFilter}}</p>
                    <p>配送地址: {{item.address}}</p>
                  </span>
                  <i class="icon text-gray">&#xe61a;</i>
                </a>
                <div class="item">
                  <!-- <div class="pull-left">
                    <span class="text text-gray">奖励积分：{{item.integralCountCost}}</span>
                  </div> -->
                  <div class="button-r">
                	{% if item.dispatchStatus == 11 %}
                	<a class="button inline default little" href="tel:{{item.createMobile}}">联系用户</a>&nbsp;
                	{% endif %}
                	{% if item.dispatchStatus == 10 || item.dispatchStatus == 11 %}
                	<button data-curid="{{item.id}}" class="button inline default little cancelHK">取消配送</button>&nbsp;
                	{% endif %}
                	{% if item.dispatchStatus == 10 %}
                	<button data-curid="{{item.id}}" data-code="{{item.code}}" class="button primary light inline little scanner-get">扫码领取</button>&nbsp;
                	{% endif %}
                	{% if item.dispatchStatus == 11 %}
                	<button data-curid="{{item.id}}" class="button primary light inline little scaner-qianshou">扫码签收</button>
                	{% endif %}
                  </div>
                </div>
              </div>
          </div>
        {% endfor %}
      {% else %}
        <div class="plate">
          <div class="draw">
            <img src="http://7xjyap.com2.z0.glb.qiniucdn.com/image-2f0df3ff-2a9a-4367-a7df-bd53231b0a9f.png" alt="空白" />
            <h4 class="title">您还没有配送单</h4>
          </div>
        </div>
      {% endif %}
      </div>
    </div>
  </section>
  {% raw %}
    <script id="signedTempl" type="text/swig-template">
      {% for item in list %}
        <div class="card hspace vspace">
          <div class="item round">
              <div class="list compact">
                <div class="item">
                  <div class="progress">
                    <div class="line"></div>
                    <div class="flexbox">
                      <div class="item">
                        {% if item.dispatchStatus == 10 %}
                        <div class="circle circlef activec"></div>
                        <p class="text text-sm vspace text-left text-orange">已接单</p>
                        {% else %}
                        <div class="circle circlef"></div>
                        <p class="text text-sm vspace text-left">已接单</p>
                        {% endif %}

                      </div>
                      <div class="item">
                          {% if item.dispatchStatus == 11 %}
                        <div class="circle circlem activec"></div>
                        <p class="text text-sm vspace text-center text-orange">配送中</p>
                        {% else %}
                        <div class="circle circlem"></div>
                        <p class="text text-sm vspace text-center">配送中</p>
                        {% endif %}

                      </div>
                      <div class="item">
                        {% if item.dispatchStatus == 12 %}
                        <div class="circle circled activec"></div>
                        <p class="text text-sm vspace text-right text-orange">已完成</p>
                        {% else %}
                        <div class="circle circled"></div>
                        <p class="text text-sm vspace text-right">已完成</p>
                        {% endif %}

                      </div>
                    </div>
                  </div>
                </div>
                <a class="item" href="/delivery/expressd/{{item.code}}">
                  <span class="text text-sm text-gray">
                    <p>配送单号：{{item.code}}</p>
                    <p>配送时间:  {{item.postDate}} {{item.postWeek}} {{item.postPeriod | postPeriodFilter}}</p>
                    <p>配送地址: {{item.address}}</p>
                    <!-- <p>快递数量: {{item.courierCount}} &nbsp;&nbsp;<span class="text">花费积分: {{item.integralCountCost}}</span></p> -->
                  </span>
                  <i class="icon text-gray">&#xe61a;</i>
                </a>
                <div class="item pull-right">
                  {% if item.dispatchStatus == 11 %}
                  <a class="button inline default little" href="tel:{{item.createMobile}}">联系用户</a>&nbsp;
                  {% endif %}
                  {% if item.dispatchStatus == 10 || item.dispatchStatus == 11 %}
                  <button data-curid="{{item.id}}" class="button inline default little cancelHK">取消配送</button>&nbsp;
                  {% endif %}
                  {% if item.dispatchStatus == 10 %}
                  <button data-curid="{{item.id}}" class="button inline default little scanner-get">扫码领取</button>&nbsp;
                  {% endif %}
                  {% if item.dispatchStatus == 11 %}
                  <button data-curid="{{item.id}}" class="button inline default little scaner-qianshou">扫码签收</button>
                  {% endif %}
                </div>
              </div>
          </div>
        </div>
        {% endfor %}
    </script>
  {% endraw %}
{% endblock %}
{% block script %}
  {% parent %}
  <script src="{{ '/static/js/delivery.js'|version }}"></script>
{% endblock %}